package org.thunms.framework.utils;

import java.io.IOException;
import java.util.Date;

import org.codehaus.jackson.JsonGenerator;
import org.codehaus.jackson.JsonProcessingException;
import org.codehaus.jackson.map.JsonSerializer;
import org.codehaus.jackson.map.SerializerProvider;
/**
 * yyyy-MM-dd HH:mm:ss  格式化日期
 * 
 */
public class JsonYearDateTimeSerializer extends JsonSerializer<Date>  {

	@Override
	public void serialize(Date date, JsonGenerator jsonGenerator, SerializerProvider provider) throws IOException,
			JsonProcessingException {
		jsonGenerator.writeString(DateUtil.format(date));
	}

}
